/*-------------------------------Login Form Validation-------------------------------------*/
			function validate_login(e) 
			{
				if(isEmptyTextBox(e["username"], "Please enter user name", "uname")) 
				{
					return false;
				}
			
				if(isEmptyTextBox(e["password"], "Please enter password", "pwd"))
				{
					return false;
				}
				return true; 
				
			}
			
/*--------------------------------End Of Login Form Validation-------------------------------------*/		
			
			
/*-------------------------------Add_Fund_House Form Validation-------------------------------------*/
			
			function validate_fund_house(e) 
			{
				if(isEmptyTextBox(e["fund_house_code"], "Please enter code", "code")) 
				{
					return false;
				}
			
				if(isEmptyTextBox(e["fund_house_name"], "Please enter Fund House Name", "fund_name"))
				{
					return false;
				}
				
				if(isDigit(e["fund_house_code"], "Please enter digits", "code")) 
				{
					return false;
				}
			
				if(isAlphabet(e["fund_house_name"], "Please enter alphabets", "fund_name"))
				{
					return false;
				}  
				
				return true; 
			}			
			
			
			function fund_name()
/*-------------------------------End Of Add_Fund_House Form Validation-------------------------------------*/		
			
/*-------------------------------Registration Form Validation-------------------------------------*/			
			
			function validate_registration(e) 
			{
				if(isEmptyTextBox(e["fname"], "Please enter first name", "fnm")) 
				{
					return false;
				}
				
				if(isAlphabet(e["fname"], "Please enter only alphabets", "fnm"))
				{
					return false;
				}  
			
				if(isEmptyTextBox(e["lname"], "Please enter last name", "lnm"))
				{
					return false;
				}
				
				if(isAlphabet(e["lname"], "Please enter only alphabets", "lnm"))
				{
					return false;
				}  
				
				if(isRadioChecked(e["gender"], "Please select any gender", "gen")) 
				{
					return false;
				}
				
				if(isEmptyTextBox(e["mobileno"], "Please enter mobile no", "mob_no")) 
				{
					return false;
				}
			
				if(isDigit(e["mobileno"], "Please enter only digits", "mob_no")) 
				{
					return false;
				}
				
				if(isValidMobileNo(e["mobileno"], "Please enter correct mobile number", "mob_no"))
				{
					return false;
				}
				
				if(isEmptyTextBox(e["email"], "Please enter email address", "email_id"))
				{
					return false;
				}

				if(isValidEmail(e["email"], "Please enter correct email address", "email_id"))
				{
					return false;
				}
					
				if(isRadioChecked(e["status"], "Please select any status", "stat")) 
				{
					return false;
				}
				
				if(isRadioChecked(e["occupation"], "Please select any occupation", "occup")) 
				{
					return false;
				}

				if(isValidTelephoneNo(e["homeno"], "Please enter correct Telephone number", "home_no"))
				{
					return false;
				}
				
				if(isDigit(e["homeno"], "Please enter only digits", "home_no")) 
				{
					return false;
				}
				
				if(isValidTelephoneNo(e["officeno"], "Please enter correct Office number", "office_no"))
				{
					return false;
				}
				
				if(isDigit(e["officeno"], "Please enter only digits", "office_no")) 
				{
					return false;
				}
				
				if(isValidPinCode(e["c_pincode"], "Please enter correct pin code", "c_pin")) 
				{
					return false;
				}
				
				if(isValidPinCode(e["o_pincode"], "Please enter correct pin code", "o_pin")) 
				{
					return false;
				}
				

				return true;  
			}			
			
/*-------------------------------End Of Registration Form Validation-------------------------------------*/				
	
			
/*--------------------------------------Validation For Empty TextBoxes--------------------------------------*/			
			function isEmptyTextBox(e, err_msg, label_id)
			{
				var id = document.getElementById(label_id);
				if(e.value.replace(/\s+$/, "") == "") 
				{
					id.className = "";
					id.innerHTML = err_msg;
					e.value = "";
					/*e.focus();*/
					return true;
				}
				else 
				{
					id.innerHTML = "";			
					id.className = "";
					e.className = "text_style";
					return false;					
				}
			}
/*--------------------------------------------------------------------------------------------------------*/					

/*-----------------------------------Validation For Digit Values--------------------------------------*/				
						
			 function isDigit(e, err_msg, label_id)
			 {
				var id = document.getElementById(label_id);
				var reg = new RegExp("^[-]?[0-9]+[\.]?[0-9]+$"); /*^[0-9a-zA-Z]*/
				
				if(reg.test(e.value))
				{
					
					id.innerHTML = "";			
					id.className = "";
					e.className = "text_style";
					return false;
				}	
				else
				{
					
					id.className = "";
					id.innerHTML = err_msg;
					e.value = "";
					e.focus();
					return true;
				}	 	
			} 
/*--------------------------------------------------------------------------------------------------------*/
			 
/*-----------------------------------Validation For Alphabet Values--------------------------------------*/				 
			 
			function isAlphabet(e, err_msg, label_id)
			{
				var id = document.getElementById(label_id);
				var reg = new RegExp("^[a-zA-Z]+$"); 
				
				if(reg.test(e.value))
				{	
					id.innerHTML = "";			
					id.className = "";
					e.className = "text_style";
					return false;
				}	
				else
				{
					
					id.className = "";
					id.innerHTML = err_msg;
					e.value = "";
					e.focus();
					return true;
				}	 	
			}  
/*--------------------------------------------------------------------------------------------------------*/
	
/*-----------------------------------Validation For Email Field--------------------------------------*/				
			function isValidEmail(e, err_msg, label_id)
			 {
				var id = document.getElementById(label_id);
				var reg = new RegExp("^[0-9a-zA-Z]+@[0-9a-zA-Z]+[\.]{1}[0-9a-zA-Z]+[\.]?[0-9a-zA-Z]+$"); 
				
				 if(reg.test(e.value))
				{
					
					id.innerHTML = "";			
					id.className = "";
					e.className = "text_style";
					return false;
				}	
				else
				{
					
					id.className = "";
					id.innerHTML = err_msg;
					e.value = "";
					e.focus();
					return true;
				}	 	
			}  
/*----------------------------------------------------------------------------------------------------*/
			
/*-----------------------------------Validation For Mobile Number Field-----------------------------------*/	
			
			function isValidMobileNo(e, err_msg, label_id)
			 {
				var id = document.getElementById(label_id);
				
				if((e.value).length > 10 || (e.value).length <10)
				{					
						id.className = "";
						id.innerHTML = err_msg;
						e.value = "";
						e.focus();
						return true;	 					
				}	
				else
				{
					id.innerHTML = "";			
					id.className = "";
					e.className = "text_style";
					return false;				
				}	 	
			} 
/*----------------------------------------------------------------------------------------------------*/
			
/*------------------------------Validation For Telephone Number Field-----------------------------------*/				
			function isValidTelephoneNo(e, err_msg, label_id)
			 {
				var id = document.getElementById(label_id);
				
				if((e.value).length > 8 || (e.value).length <8)
				{					
						id.className = "";
						id.innerHTML = err_msg;
						e.value = "";
						e.focus();
						return true;	 					
				}	
				else
				{
					id.innerHTML = "";			
					id.className = "";
					e.className = "text_style";
					return false;				
				}	 	
			} 
/*--------------------------------------------------------------------------------------------------*/
			
/*------------------------------Validation For Pin Code Field-----------------------------------*/
			
			function isValidPinCode(e, err_msg, label_id)
			 {
				var id = document.getElementById(label_id);
				
				if((e.value).length > 6 || (e.value).length <6)
				{					
						id.className = "";
						id.innerHTML = err_msg;
						e.value = "";
						e.focus();
						return true;	 					
				}	
				else
				{
					id.innerHTML = "";			
					id.className = "";
					e.className = "text_style";
					return false;				
				}	 	
			}
			
/*---------------------------------------------------------------------------------------------*/
			
		
			
/*------------------------------Validation For Radio Button----------------------------------*/		
			
			function isRadioChecked(e, err_msg, label_id)
			 {
				var id = document.getElementById(label_id);
				
				var result=0;
				for(var i=0;i<e.length;i++)
				{
					if(e[i].checked==true)
					{
						result=1;	
					}	
				}	
				if(result==1)
				{
					result=0;
					id.innerHTML = "";			
					id.className = "";
					e.className = "radio_style";
					return false;
				}	
				else
				{
					id.className = "";
					id.innerHTML = err_msg;
					e.value = "";
					e.focus();
					return true;
				}			
			}  
/*--------------------------------------------------------------------------------------------------*/